Skip to main content

Return Results

When using the pipeline editor the payload varible is available to you at anytime to modify, and consists of the data in the input pipeline. What ever value is stored in the input value at the end of the execution will be the output value (assuming you do not call return).

If you would like to use a different output value you can the return val method to directory output from the pipeline. The paramater val will be the output value from the pipeline. This value can either be a primitive JavaScript varible or a Lazy object.

The first return method call is the final output all other proceeding return calls will be ignored. The other return calls will still be logged in the console, but will not be the output.


Basic Examples

Basic Lazy Example

Regular return process, what ever the payload varible stores is the output.

// INPUT: 20 → OUTPUT: 30
payload = Lazy(payload)
.add(10);

Basic Raw Example

You can override the payload varible directly to alter the output.

// INPUT: 20 → OUTPUT: 30
payload += 10;

Return Examples

Return Lazy Example

The return value can be a primitive JavaScript varible or a Lazy object. If it is a Lazy object, the .valueOf() method is called before export.

// INPUT: 20 → OUTPUT: 30
let output = Lazy(20);
output = output.add(10);
return output;

Return Raw Example

The return value can be a primitive JavaScript varible.

// INPUT: 20 → OUTPUT: 30
let output = payload;
output += 10;
return output;

Multiple Return Example

The first return value is the final output, proceeding returns are ignored. All other returns are logged in the console, but ignored as the output.

// OUTPUT: 30
return 30;
return "Foo";
return Lazy(-25);